/*
 *
 * Farbeanzeige.java
 *
 * Created on 14. Juni 2007, 11:03
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package DieSiedler;

import javax.swing.JPanel;
import java.awt.*;

/**
 *
 * @author Michi
 */
public class Farbeanzeige extends JPanel{
    private Color farbe = Color.LIGHT_GRAY;
    
    /** Creates a new instance of Farbeanzeige */
    public Farbeanzeige() {
    }
    
    public void setFarbe(Color farbe){
        this.farbe = farbe;
    }

    public void paint(Graphics g){
        //int h  = this.getHeight() - 26;
    	int h  = this.getHeight() / 2;
    	//int b  = this.getWidth()  - 40;
        int b = h;
    	int x0 = this.getWidth() - b - 2;
        int y0 = (this.getHeight() - h)/2;
        g.setColor(Color.BLACK);
        g.fillRect(x0, y0, b, h);
        g.setColor(farbe);
        g.fillRect(x0+1, y0+1, b-2, h-2);
    }
    
}
